import {mapGetters} from 'vuex'

export default {
  computed:{
    ...mapGetters('my_card',['total'])
  },
  onShow() {
    this.setTabBarBadge()
  },
  watch:{
    total(){
       this.setTabBarBadge()
    }
  },
  methods:{
    setTabBarBadge (){
      uni.setTabBarBadge({
        index: 2,
        text: this.total + ''
      })
    }
  }
}